**Clean wave 1**

**import raw data
import spss using "RAW_wave1_National.sav", clear


***NOTE: variables are labeled with "1" to define them as taking place in wave 1 of the survey

**Rename and define education variable
rename educ educ1
label define educ_label 1 "No HS" 2 "High school graduate" 3 "Some college" 4 "2-year" 5 "4-year" 6 "Post-grad"
label values educ1 educ_label

**Designate weight for wave 1
rename weight weight1

**Define and label household size
rename q1 hhsize1
label define hhsizelabel 1 "1" 2 "2" 3 "3" 4 "4" 5 "5" 6 "6" 7 "7" 8 "8" 9 "9" 10 "10" 11 "11" 12 "12" 13 "13" 14 "14" 15 "15" 16 "16" 17 "17" 18 "18" 19 "19" 20 "20"
label values hhsize1 hhsizelabel

**Define and label number of children under 5 in the household
rename q2_2 hh_under51
recode hh_under51 (1=0) (2=1) (3=2) (4=3) (5=4)
label define hhunder5label 0 "0" 1 "1" 2 "2" 3 "3" 4 "More than 3"
label values hh_under51 hhunder5label

**Define and label number of people over 65 in the household
gen hh_over651 =.
replace hh_over651=0 if q2_3==1
replace hh_over651=1 if q2_3==2
replace hh_over651=1 if q2_3==3
replace hh_over651=1 if q2_3==4
replace hh_over651=1 if q2_3==5
label define hh_over65_label 0 "0" 1 "1" 2 "2" 3 "3" 4 "more than 3"
label val hh_over651 hh_over65_label

**Define and label number of people with disability in the household
gen hh_disability1=.
replace hh_disability1=0 if q2_4==1
replace hh_disability1=1 if q2_4==2
replace hh_disability1=2 if q2_4==3
replace hh_disability1=3 if q2_4==4
replace hh_disability1=4 if q2_4==5
label define hh_disability_label 0 "0" 1 "1" 2 "2" 3 "3" 4 "more than 3"
label val hh_disability1 hh_disability_label
drop q2_4



**Rename income brackets for individuals based on their household size
rename q38_1 hh1_income1
rename q38_2 hh2_income1
rename q38_3 hh3_income1
rename q38_4 hh4_income1
rename q38_5 hh5_income1
rename q38_6 hh6_income1
rename q38_7 hh7_income1
rename q38_8 hh8_income1
rename q38_all income1

**Open responses to dwelling question (e.g., what best describes where people live)
rename q5_open dwelling_open1


**Hand coding of common open responses to dwelling question
gen dwelling_duplex = strpos(dwelling_open, "Duplex") | strpos(dwelling_open, "DUPLEX")

gen dwelling_house = strpos(dwelling_open, "House") | strpos(dwelling_open, "house") | strpos(dwelling_open, "Brick house") | strpos(dwelling_open, "4 Bedroom House") | strpos(dwelling_open, "2 family home") | strpos(dwelling_open, "2 family") | strpos(dwelling_open, "Townhouse") | strpos(dwelling_open, "Multihouse") | strpos(dwelling_open, "Manufactured home") | strpos(dwelling_open, "town home") 

gen dwelling_hotel = strpos(dwelling_open, "hotel") | strpos(dwelling_open, "Cheap motel") | strpos(dwelling_open, "Motel") | strpos(dwelling_open, "temporary motel")

gen dwelling_rentapt = strpos(dwelling_open, "a rented bacement of a home that is converted into an apt.") | strpos(dwelling_open, "Rent basement of a house with seperate entrance") | strpos(dwelling_open, "Dorm")

gen dwelling_unhomed = strpos(dwelling_open, "shelter") | strpos(dwelling_open, "Homeless") | strpos(dwelling_open, "Homeless shelter") | strpos(dwelling_open, "Place to place")

gen dwelling_rv = strpos(dwelling_open, "RV") | strpos(dwelling_open, "Rv")

**Coding and labeling dwelling type for each respondent
gen dwelling_type1=.
replace dwelling_type1=1 if q5 ==1
replace dwelling_type1=2 if q5 ==2 | dwelling_duplex==1 | dwelling_rentapt==1
replace dwelling_type1=3 if q5 ==4 | dwelling_house==1
replace dwelling_type1=4 if q5==5
replace dwelling_type1=5 if q5==6
label var dwelling_type1 "Dwelling Type"
label define dwelling_typelabel 1 "Trailer or mobile home" 2 "Apartment/duplex/condominum" 3 "Detached, single family home" 4 "Attached single family home" 5 "Other"
label values dwelling_type1 dwelling_typelabel
drop q5





**Renaming responses to dwelling conditions (e.g., household deficiencies), then cleaning responses
rename q6_1 poor_insulation1
rename q6_2 drafty1
rename q6_3 mold1
rename q6_4 holes1
rename q6_5 plumbing1
rename q6_6 exposed_sockets1
rename q6_7 nonworking_stove_fridge1
rename q6_8 broken_heating1
rename q6_9 broken_ac1

replace poor_insulation1=0 if poor_insulation1 !=1
label define poorinsulation_label 0 "no" 1 "yes"
label values poor_insulation1 poorinsulation_label

replace drafty1=0 if drafty1 !=1
label define drafty_label 0 "no" 1 "yes"
label values drafty1 drafty_label

replace mold1=0 if mold1 !=1
label define mold_label 0 "no" 1 "yes"
label values mold1 mold_label

replace holes1=0 if holes1 !=1
label define holes_label 0 "no" 1 "yes"
label values holes1 holes_label

replace plumbing1=0 if plumbing1 !=1
label define plumbing_label 0 "no" 1 "yes"
label values plumbing1 plumbing_label

replace exposed_sockets1=0 if exposed_sockets1 !=1
label define exposed_sockets_label 0 "no" 1 "yes"
label values exposed_sockets1 exposed_sockets_label

replace nonworking_stove_fridge1=0 if nonworking_stove_fridge1 !=1
label define nonworking_stove_label 0 "no" 1 "yes"
label values nonworking_stove_fridge1 nonworking_stove_label

replace broken_heating1=0 if broken_heating1 !=1
label define broken_heating_label 0 "no" 1 "yes"
label values broken_heating1 broken_heating_label

replace broken_ac1=0 if broken_ac1 !=1
label define broken_ac_label 0 "no" 1 "yes"
label values broken_ac1 broken_ac_label

***Binary variable representing if a respondent indicated they had poor insulation, drafty air in their home, mold, holes, bad plumbing, exposed sockets, a stove or fridge that isn't currently working, or broken AC or heating
gen dwelling_condition1=.

replace dwelling_condition1=0 if poor_insulation1==0 & drafty1==0 & mold1 ==0 & holes1==0 & plumbing1==0 & exposed_sockets1==0 & nonworking_stove_fridge1==0 & broken_heating1==0 & broken_ac1==0

replace dwelling_condition1=1 if poor_insulation1==1 | drafty1==1 | mold1 ==1 | holes1==1 | plumbing1==1 | exposed_sockets1==1 |nonworking_stove_fridge1==1 | broken_heating1==1 | broken_ac1==1

label define dwelling_conditionlabel 0 "No dwelling conditions" 1 "At least 1 dwelling condition"
label values dwelling_condition1 dwelling_conditionlabel


**Fuel type that household uses for energy (electricity, gas, wood, propane, or fuel oil)
rename q7_1 electricity1
replace electricity1=0 if electricity1 !=1
label define electricity_label 0 "no" 1 "yes"
label values electricity1 electricity_label

rename q7_2 gas1
replace gas1=0 if gas1 !=1
label define gas_label 0 "no" 1 "yes"
label values gas1 gas_label

rename q7_3 wood1
replace wood1=0 if wood1 !=1
label define wood_label 0 "no" 1 "yes"
label values wood1 wood_label

rename q7_4 propane1
replace propane1=0 if propane1 !=1
label define propane_label 0 "no" 1 "yes"
label values propane1 propane_label

rename q7_5 fueloil1
replace fueloil1=0 if fueloil1 !=1
label define fueloil_label 0 "no" 1 "yes"
label values fueloil1 fueloil_label

*Fuel type open responses
rename q7_open fueltype_open1

gen pellet = strpos(fueltype_open, "pellets") | strpos(fueltype_open, "Pellets") | strpos(fueltype_open, "Pellet stove")

gen radiator = strpos(fueltype_open, "steam radiator") | strpos(fueltype_open, "Radiator")


** Who pays for household fuel? Options: household pays all, all included in rent, some are paid by the household, some included in rent
rename q8_1_open fuelpay_open

gen fuelpay_landlord = strpos(fuelpay_open, "owners pays it all") | strpos(fuelpay_open, "Landlord") | strpos(fuelpay_open, "pAid by landlord") | strpos(fuelpay_open, "Owner pays all utilities") | strpos(q8_2_open, "Owner pays") | strpos(q8_5_open, "Landlord")

gen fuelpay_hhpays = strpos(fuelpay_open, "I Pay my own") | strpos(fuelpay_open, "me") | strpos(fuelpay_open, "I paid my utilities") | strpos(fuelpay_open, "me") | strpos(q8_2_open, "me")

gen fuel_payment1=.
replace fuel_payment1=1 if q8_1==1 | fuelpay_hhpays==1
replace fuel_payment1=2 if q8_1==2 | fuelpay_landlord==1
replace fuel_payment1=3 if q8_1==3
replace fuel_payment1=4 if q8_1==4
replace fuel_payment1=5 if q8_1>4
label var fuel_payment1 "Fuel Payment"
label define fuel_paymentlabel 1 "Household pays all" 2 "All included in Rent" 3 "Some household, some rent" 4 "Other" 5 "Dont know/not asked"
label values fuel_payment1 fuel_paymentlabel



***Could not pay household energy bill in the last year (May 2019-May 2020)
rename q9 hhbill_year
recode hhbill_year(2=0)
label define hhbill 0 "no" 1 "yes"
label val hhbill_year hhbill
replace hhbill_year=0 if hhbill_year !=1

***Could not pay household energy bill in the last 3 months
rename q10 hhbill_3months1
replace hhbill_3months1=0 if hhbill_3months !=1
label define hhbill_3label 0 "no" 1 "yes"
label values hhbill_3months1 hhbill_3label

**Could noy pay household energy bill in May
rename q11 hhbill_may
replace hhbill_may=0 if hhbill_may !=1
label define hhbill_label 0 "no" 1 "yes"
label values hhbill_may hhbill_label

**How many times did a household receive a disconnection notice in the last year (May 2019-May 2020)
rename q12 notice_year
replace notice_year=0 if notice_year !=1 & notice_year !=2 & notice_year !=3 & notice_year !=4 & notice_year !=5 & notice_year !=6 & notice_year !=7 & notice_year !=8 & notice_year !=9 & notice_year !=10 & notice_year !=11 & notice_year !=12

**How many times did a household get disconnected in the last year (May 2019-May 2020)
rename q13 disconnect_year
replace disconnect_year=0 if disconnect_year !=1 & disconnect_year !=2 & disconnect_year !=3 & disconnect_year !=4 & disconnect_year !=5 & disconnect_year !=6 & disconnect_year !=7 & disconnect_year !=8 & disconnect_year !=9 & disconnect_year !=10 & disconnect_year !=11 & disconnect_year !=12

**How many times did a household receive a disconnection notice in the last 3 months
rename q14 notice_3months1
replace notice_3months1=0 if notice_3months1 !=1 & notice_3months1 !=2 & notice_3months1 !=3
label define notice_3label 0 "no" 1 "once" 2 "twice" 3 "three times"
label values notice_3months1 notice_3label

**How many times did a household get disconnected in the last 3 months
rename q15 disconnect_3months1
replace disconnect_3months1=0 if disconnect_3months1 !=1 & disconnect_3months1 !=2 & disconnect_3months1 !=3
label define disconnect_3label 0 "no" 1 "once" 2 "twice" 3 "three times"
label values disconnect_3months1 disconnect_3label

**did household receive a disconnection notice in May
rename q16 notice_may
replace notice_may=0 if notice_may !=1
label define notice_label 0 "no" 1 "yes"
label values notice_may notice_label

**did household get disconnected in May
rename q17 disconnect_may
replace disconnect_may=0 if disconnect_may !=1
label define disconnect_label 0 "no" 1 "yes"
label values disconnect_may disconnect_label

**How much does repondent pay, on average, in monthly rent (in $)
rename q18_rent monthly_rent1

**How much does repondent pay, on average, in monthly energy bil (in $)
rename q18_ebill monthly_energy1

**How much does repondent pay, on average, in monthly energy bil (in $)
rename q18_groceries monthly_groceries1

**Does a household member require the use of an at-home electronic device?
rename q19 electronic_device1
recode electronic_device1 (2=0)
label var electronic_device "device"
label define devicelabel 0 "no" 1 "yes"
label values electronic_device devicelabel

**are respondents' recent energy bills less than, more than, are about the same amount as a typical month
rename q20 energybill_change1



**did a respondent receieve assistance in paying their energy bill in the last year from the following sources: government agency, their energy provider, a friend or family member, a faith-based organization, a nonprofit, a payday lender, or a bank loan
rename q21_1 gov_agency_yr
rename q21_2 energy_provider_yr
rename q21_3 friend_family_yr
rename q21_4 faith_org_yr
rename q21_5 nonprofit_yr
rename q21_6 payday_lender_yr
rename q21_7 bankloan_yr

recode gov_agency_yr (2=0)
label define gov_agency_yr_label 0 "no" 1 "yes"
label values gov_agency_yr gov_agency_yr_label

recode energy_provider_yr (2=0)
label define energy_provider_yr_label 0 "no" 1 "yes"
label values energy_provider_yr energy_provider_yr_label

recode friend_family_yr (2=0)
label define friend_family_yr_label 0 "no" 1 "yes"
label values friend_family_yr friend_family_yr_label

recode faith_org_yr (2=0)
label define faith_org_yr_label 0 "no" 1 "yes"
label values faith_org_yr faith_org_yr_label

recode nonprofit_yr (2=0)
label define nonprofit_yr_label 0 "no" 1 "yes"
label values nonprofit_yr nonprofit_yr_label

recode payday_lender_yr (2=0)
label define payday_lender_yr_label 0 "no" 1 "yes"
label values payday_lender_yr payday_lender_yr_label

recode bankloan_yr (2=0)
label define bankloan_yr_label 0 "no" 1 "yes"
label values bankloan_yr bankloan_yr_label

rename q21_open energyassist_lastyr_open1

**Binary variable indicating if a respondent received assistance paying their energy bill in the last year
gen energy_assistance_year=.

replace energy_assistance_year=0 if gov_agency_yr==0 & energy_provider_yr==0 & friend_family_yr==0 & faith_org_yr==0 & nonprofit_yr==0 & payday_lender_yr==0 & bankloan_yr==0

replace energy_assistance_year=1 if gov_agency_yr==1 | energy_provider_yr==1 | friend_family_yr==1 | faith_org_yr==1 | nonprofit_yr==1 | payday_lender_yr==1 | bankloan_yr==1

label define energy_assistlabel 0 "No asssitance" 1 "Assistance from at least one source"
label values energy_assistance_year energy_assistlabel


**did a respondent receieve assistance in paying their energy bill in the last 3 months from the following sources: government agency, their energy provider, a friend or family member, a faith-based organization, a nonprofit, a payday lender, or a bank loan
rename q22_1 gov_agency_3mos1
rename q22_2 energy_provider_3mos1
rename q22_3 friend_family_3mos1
rename q22_4 faith_org_3mos1
rename q22_5 nonprofit_3mos1
rename q22_6 payday_lender_3mos1
rename q22_7 bankloan_3mos1

replace gov_agency_3mos1=0 if gov_agency_3mos1 !=1
label define gov_agency_3label 0 "no" 1 "yes"
label values gov_agency_3mos1 gov_agency_3label

replace energy_provider_3mos1=0 if energy_provider_3mos1 !=1
label define energy_provider_3label 0 "no" 1 "yes"
label values energy_provider_3mos1 energy_provider_3label

replace friend_family_3mos1=0 if friend_family_3mos1 !=1
label define friend_family_3label 0 "no" 1 "yes"
label values friend_family_3mos1 friend_family_3label

replace faith_org_3mos1=0 if faith_org_3mos1 !=1
label define faith_org_3label 0 "no" 1 "yes"
label values faith_org_3mos1 faith_org_3label

replace nonprofit_3mos1=0 if nonprofit_3mos1 !=1
label define nonprofit_3label 0 "no" 1 "yes"
label values nonprofit_3mos1 nonprofit_3label

replace payday_lender_3mos1=0 if payday_lender_3mos1 !=1
label define payday_lender_3label 0 "no" 1 "yes"
label values payday_lender_3mos1 payday_lender_3label

replace bankloan_3mos1=0 if bankloan_3mos1 !=1
label define bankloan_3label 0 "no" 1 "yes"
label values bankloan_3mos1 bankloan_3label


**Binary variable indicating if a respondent received assistance paying their energy bill in the last year
gen energy_assistance_3mos1=.

replace energy_assistance_3mos1=0 if gov_agency_3mos1==0 & energy_provider_3mos1==0 & friend_family_3mos1==0 & faith_org_3mos1==0 & nonprofit_3mos1==0 & payday_lender_3mos1==0 & bankloan_3mos1==0

replace energy_assistance_3mos1=1 if gov_agency_3mos1==1 | energy_provider_3mos1==1 | friend_family_3mos1==1 | faith_org_3mos1==1 | nonprofit_3mos1==1 | payday_lender_3mos1==1 | bankloan_3mos1==1

label define energy_assist3label 0 "No assistance" 1 "Assistance from at least one source"
label values energy_assistance_3mos1 energy_assist3label


**did a respondent receieve assistance in paying their energy bill in May from the following sources: government agency, their energy provider, a friend or family member, a faith-based organization, a nonprofit, a payday lender, or a bank loan
rename q23_1a gov_agency_may
rename q23_2a energy_provider_may
rename q23_3a friend_family_may
rename q23_4a faith_org_may
rename q23_5a nonprofit_may
rename q23_6a payday_lender_may
rename q23_7a bankloan_may

replace gov_agency_may=0 if gov_agency_may !=1
label define gov_agency_label 0 "no" 1 "yes"
label values gov_agency_may gov_agency_label

replace energy_provider_may=0 if energy_provider_may !=1
label define energy_provider_label 0 "no" 1 "yes"
label values energy_provider_may energy_provider_label

replace friend_family_may=0 if friend_family_may !=1
label define friend_family_label 0 "no" 1 "yes"
label values friend_family_may friend_family_label

replace faith_org_may=0 if faith_org_may !=1
label define faith_org_label 0 "no" 1 "yes"
label values faith_org_may faith_org_label

replace nonprofit_may=0 if nonprofit_may !=1
label define nonprofit_label 0 "no" 1 "yes"
label values nonprofit_may nonprofit_label

replace payday_lender_may=0 if payday_lender_may !=1
label define payday_lender_label 0 "no" 1 "yes"
label values payday_lender_may payday_lender_label

replace bankloan_may=0 if bankloan_may !=1
label define bankloan_label 0 "no" 1 "yes"
label values bankloan_may bankloan_label


**Binary variable indicating if a respondent received assistance paying their energy bill in the last year
gen energy_assistance_may=.

replace energy_assistance_may=0 if gov_agency_may==0 & energy_provider_may==0 & friend_family_may==0 & faith_org_may==0 & nonprofit_may==0 & payday_lender_may==0 & bankloan_may==0

replace energy_assistance_may=1 if gov_agency_may==1 | energy_provider_may==1 | friend_family_may==1 | faith_org_may==1 | nonprofit_may==1 | payday_lender_may==1 | bankloan_may==1

label define energy_assistmaylabel 0 "No assistance" 1 "Assistance from at least one source"
label values energy_assistance_may energy_assistmaylabel

drop q23_8a

**How often a household had to forego basic household expenses to pay an energy bill in the last year (almost every month, some months, 1 or 2 months, never)
rename q23 forego_expenses_yr

**did respondent receive WAP (Weatherization Assistance Program), LIHEAP (Low-Income Housing Energy Assistance Progam), SNAP, TANF, SSI, Medicaid, Veterans Benefits, Unemployment Insurance, and a COVID stimulus check in the last year
rename q24_1 wap_yr
rename q24_2 liheap_yr
rename q24_3 snap_yr
rename q24_4 tanf_yr
rename q24_5 ssi_yr
rename q24_6 medicaid_yr
rename q24_7 vet_benefits_yr
rename q24_8 unemp_insurance_yr
rename q24_9 covid_stimulus_yr

replace wap_yr=0 if wap_yr !=1
label define wap_yrlabel 0 "no" 1 "yes"
label values wap_yr wap_yrlabel

replace liheap_yr=0 if liheap_yr !=1
label define liheap_yrlabel 0 "no" 1 "yes"
label values liheap_yr liheap_yrlabel

replace snap_yr=0 if snap_yr !=1
label define snap_yrlabel 0 "no" 1 "yes"
label values snap_yr snap_yrlabel

replace tanf_yr=0 if tanf_yr !=1
label define tanf_yrlabel 0 "no" 1 "yes"
label values tanf_yr tanf_yrlabel

replace ssi_yr=0 if wap_yr !=1
label define ssi_yrlabel 0 "no" 1 "yes"
label values ssi_yr ssi_yrlabel

replace medicaid_yr=0 if medicaid_yr !=1
label define medicaid_yrlabel 0 "no" 1 "yes"
label values medicaid_yr medicaid_yrlabel

replace vet_benefits_yr=0 if vet_benefits_yr !=1
label define vet_benefits_yrlabel 0 "no" 1 "yes"
label values vet_benefits_yr vet_benefits_yrlabel

replace unemp_insurance_yr=0 if unemp_insurance_yr !=1
label define unemp_insurance_yrlabel 0 "no" 1 "yes"
label values unemp_insurance_yr unemp_insurance_yrlabel

rename q24_open govassistance_lastyr_open1

**Binary variable representing whether respondent received government assistance in the previous year (EXCLUDING STIMULUS CHECKS)
gen gov_assistance_year=.

replace gov_assistance_year=0 if wap_yr==0 & liheap_yr==0 & snap_yr==0 & tanf_yr==0 & ssi_yr==0 & medicaid_yr==0 & vet_benefits==0 & unemp_insurance_yr==0

replace gov_assistance_year=1 if wap_yr==1 | liheap_yr==1 | snap_yr==1 | tanf_yr==1 | ssi_yr==1 | medicaid_yr==1 | vet_benefits==1 | unemp_insurance_yr==1

label define gov_assistyrlabel 0 "No assistance" 1 "Assistance from at least one source"
label values gov_assistance_year gov_assistyrlabel


**Did respondent receive a COVID stimulus check (Note: this survey was taken in May after the first round of checks)
gen covid_stimulus1=0
replace covid_stimulus1=1 if covid_stimulus_yr==1
label var covid_stimulus1 "Received Stimulus?"
label define stimulus_label 0 "No" 1 "Yes"
label values covid_stimulus1 stimulus_label


**did respondent receive WAP (Weatherization Assistance Program), LIHEAP (Low-Income Housing Energy Assistance Progam), SNAP, TANF, SSI, Medicaid, Veterans Benefits, Unemployment Insurance, and a COVID stimulus check in the last 3 months
rename q25_1 wap_3mos1
rename q25_2 liheap_3mos1
rename q25_3 snap_3mos1
rename q25_4 tanf_3mos1
rename q25_5 ssi_3mos1
rename q25_6 medicaid_3mos1
rename q25_7 vet_benefits_3mos1
rename q25_8 unemp_insurance_3mos1

replace wap_3mos1=0 if wap_3mos1 !=1
label define wap_3label 0 "no" 1 "yes"
label values wap_3mos1 wap_3label

replace liheap_3mos1=0 if liheap_3mos1 !=1
label define liheap_3label 0 "no" 1 "yes"
label values liheap_3mos1 liheap_3label

replace snap_3mos1=0 if snap_3mos1 !=1
label define snap_3label 0 "no" 1 "yes"
label values snap_3mos1 snap_3label

replace tanf_3mos1=0 if tanf_3mos1 !=1
label define tanf_3label 0 "no" 1 "yes"
label values tanf_3mos1 tanf_3label

replace ssi_3mos1=0 if wap_3mos1 !=1
label define ssi_3label 0 "no" 1 "yes"
label values ssi_3mos1 ssi_3label

replace medicaid_3mos1=0 if medicaid_3mos1 !=1
label define medicaid_3label 0 "no" 1 "yes"
label values medicaid_3mos1 medicaid_3label

replace vet_benefits_3mos1=0 if vet_benefits_3mos1 !=1
label define vet_benefits_3label 0 "no" 1 "yes"
label values vet_benefits_3mos1 vet_benefits_3label

replace unemp_insurance_3mos1=0 if unemp_insurance_3mos1 !=1
label define unemp_insurance_3label 0 "no" 1 "yes"
label values unemp_insurance_3mos1 unemp_insurance_3label



**Binary variable representing whether respondent received government assistance in the previous year
gen gov_assistance_3months1=.

replace gov_assistance_3months1=0 if wap_3mos1==0 & liheap_3mos1==0 & snap_3mos1==0 & tanf_3mos1==0 & ssi_3mos1==0 & medicaid_3mos1==0 & vet_benefits_3mos1==0 & unemp_insurance_3mos1==0

replace gov_assistance_3months1=1 if wap_3mos1==1 | liheap_3mos1==1 | snap_3mos1==1 | tanf_3mos1==1 | ssi_3mos1==1 | medicaid_3mos1==1 | vet_benefits_3mos1==1 | unemp_insurance_3mos1==1

label define gov_assist3months1label 0 "No assistance" 1 "Assistance from at least one source"
label values gov_assistance_3months1 gov_assist3months1label




**did respondent receive WAP (Weatherization Assistance Program), LIHEAP (Low-Income Housing Energy Assistance Progam), SNAP, TANF, SSI, Medicaid, Veterans Benefits, Unemployment Insurance, and a COVID stimulus check in May
rename q25_1a wap_may
rename q25_2a liheap_may
rename q25_3a snap_may
rename q25_4a tanf_may
rename q25_5a ssi_may
rename q25_6a medicaid_may
rename q25_7a vet_benefits_may
rename q25_8a unemp_insurance_may

replace wap_may=0 if wap_may !=1
label define wap_label 0 "no" 1 "yes"
label values wap_may wap_label


replace liheap_may=0 if liheap_may !=1
label define liheap_label 0 "no" 1 "yes"
label values liheap_may liheap_label


replace snap_may=0 if snap_may !=1
label define snap_label 0 "no" 1 "yes"
label values snap_may snap_label

replace tanf_may=0 if tanf_may !=1
label define tanf_label 0 "no" 1 "yes"
label values tanf_may tanf_label

replace ssi_may=0 if ssi_may !=1
label define ssi_label 0 "no" 1 "yes"
label values ssi_may ssi_label

replace medicaid_may=0 if medicaid_may !=1
label define medicaid_label 0 "no" 1 "yes"
label values medicaid_may medicaid_label

replace vet_benefits_may=0 if vet_benefits_may !=1
label define vet_benefits_label 0 "no" 1 "yes"
label values vet_benefits_may vet_benefits_label

replace unemp_insurance_may=0 if unemp_insurance_may !=1
label define unemp_insurance_label 0 "no" 1 "yes"
label values unemp_insurance_may unemp_insurance_label


**Binary variable representing whether respondent received government assistance in May
gen gov_assistance_may=.

replace gov_assistance_may=0 if wap_may==0 & liheap_may==0 & snap_may==0 & tanf_may==0 & ssi_may==0 & medicaid_may==0 & vet_benefits_may==0 & unemp_insurance_may==0

replace gov_assistance_may=1 if wap_may==1 | liheap_may==1 | snap_may==1 | tanf_may==1 | ssi_may==1 | medicaid_may==1 | vet_benefits_may==1 | unemp_insurance_may==1


label define gov_assistmaylabel 0 "No assistance" 1 "Assistance from at least one source"
label values gov_assistance_may gov_assistmaylabel

**Source that respondent heard about WAP from
rename q26_1_1 wap_familyfriend
rename q26_1_2 wap_digital
rename q26_1_3 wap_poster
rename q26_1_4 wap_article
rename q26_1_5 wap_tvradio
rename q26_1_6 wap_insert
rename q26_1_7 wap_flyer
rename q26_1_8 wap_email
rename q26_1_9 wap_diffprogram

**Source that respondent heard about LIHEAP from
rename q26_2_1 liheap_familyfriend
rename q26_2_2 liheap_digital
rename q26_2_3 liheap_poster
rename q26_2_4 liheap_article
rename q26_2_5 liheap_tvradio
rename q26_2_6 liheap_insert
rename q26_2_7 liheap_flyer
rename q26_2_8 liheap_email
rename q26_2_9 liheap_diffprogram

**Respondent used the following methods to keep a comfortable temperature in their home in the last year
rename q27_1 stove_yr
rename q27_2 spaceheater_yr
rename q27_3 woodstove_yr
rename q27_4 fireplace_yr
rename q27_5 hotshower_yr
rename q27_6 burntrash_yr
rename q27_7 heavycoat_yr
rename q27_8 boughtice_yr
rename q27_9 coldshower_yr

rename q27_open maintaintemp_open1

**hand coding open responses
gen fan_yr = strpos(maintaintemp_open, "Bought fans") | strpos(maintaintemp_open, "Box fan") | strpos(maintaintemp_open, "Electric fan") | strpos(maintaintemp_open, "Fan") | strpos(maintaintemp_open, "Fans") | strpos(maintaintemp_open, "fans and windows") | strpos(maintaintemp_open, "Fans and windows open before dawn/after dusk to cool the home") | strpos(maintaintemp_open, "Multiple fans") | strpos(maintaintemp_open, "Open window and use a fan, wall mounted A/C unit") | strpos(maintaintemp_open, "Opened all windows, and used an electric fan") | strpos(maintaintemp_open, "Put ice in the fan") | strpos(maintaintemp_open, "Used Fans in Summer") | strpos(maintaintemp_open, "Used a fan") | strpos(maintaintemp_open, "Used fans") | strpos(maintaintemp_open, "Window fans") | strpos(maintaintemp_open, "fans") | strpos(maintaintemp_open, "fans and windows") | strpos(maintaintemp_open, "opened windows and used ceiling fans") | strpos(maintaintemp_open, "turn on fans") | strpos(maintaintemp_open, "used fans")

gen clothes_blanket_yr = strpos(maintaintemp_open, "Blankets") | strpos(maintaintemp_open, "Cap and gloves") | strpos(maintaintemp_open, "Cover with blanket") | strpos(maintaintemp_open, "Cuddled my child under multiple blankets") | strpos(maintaintemp_open, "Extra blankets") | strpos(maintaintemp_open, "Layered clothes, used extra blankets in bedroom and living room, ate a lot of baked potatoes") | strpos(maintaintemp_open, "Lots of blankets") | strpos(maintaintemp_open, "Sleep with extra blankets") | strpos(maintaintemp_open, "Slippers and lots of blankets") | strpos(maintaintemp_open, "Stayed in bed using blankets") | strpos(maintaintemp_open, "Sweaters & heavier clothers. Blankets") | strpos(maintaintemp_open, "Used more blankets") | strpos(maintaintemp_open, "Used blankets") | strpos(maintaintemp_open, "Used more blankets") | strpos(maintaintemp_open, "Wear warmer clothes") | strpos(maintaintemp_open, "Worn heavy clothing") | strpos(maintaintemp_open, "blanket") | strpos(maintaintemp_open, "blankets, layering clothes") | strpos(maintaintemp_open, "blankets. boil water in a pot") | strpos(maintaintemp_open, "cover with blanket") | strpos(maintaintemp_open, "extra blankets") | strpos(maintaintemp_open, "several shirts and a thick sweater plus fingerless gloves.") | strpos(maintaintemp_open, "wore big sweaters") | strpos(maintaintemp_open, "worn sweat shirts, thermal sets") | strpos(maintaintemp_open, "worn sweater/sweatshirt") | strpos(maintaintemp_open, "wrap up in a blankit") | strpos(maintaintemp_open, "wrapped self in blankets")

gen ac_yr = strpos(maintaintemp_open, "Ac") | strpos(maintaintemp_open, "Compact Air Conditioner") | strpos(maintaintemp_open, "Turn on fans/window ac units. Tuned on electric heaters") | strpos(maintaintemp_open, "Use central heat an air") | strpos(maintaintemp_open, "Uses central heat an air")

**incorporating open responses into heavy coat/blanket to stay warm
gen coat_blanket_yr = 0
replace coat_blanket_yr =1 if heavycoat_yr==1 | clothes_blanket_yr ==1

replace stove_yr=0 if stove_yr !=1
label define stove_yrlabel 0 "no" 1 "yes"
label values stove_yr stove_yrlabel

replace spaceheater_yr=0 if spaceheater_yr !=1
label define spaceheater_yrlabel 0 "no" 1 "yes"
label values spaceheater_yr spaceheater_yrlabel

replace woodstove_yr=0 if woodstove_yr !=1
label define woodstove_yrlabel 0 "no" 1 "yes"
label values woodstove_yr woodstove_yrlabel

replace fireplace_yr=0 if fireplace_yr !=1
label define fireplace_yrlabel 0 "no" 1 "yes"
label values fireplace_yr fireplace_yrlabel

replace hotshower_yr=0 if hotshower_yr !=1
label define hotshower_yrlabel 0 "no" 1 "yes"
label values hotshower_yr hotshower_yrlabel

replace burntrash_yr=0 if burntrash_yr !=1
label define burntrash_yrlabel 0 "no" 1 "yes"
label values burntrash_yr burntrash_yrlabel

replace coat_blanket_yr=0 if coat_blanket_yr !=1
label define coat_blanket_yrlabel 0 "no" 1 "yes"
label values coat_blanket_yr coat_blanket_yrlabel

replace boughtice_yr=0 if boughtice_yr !=1
label define boughtice_yrlabel 0 "no" 1 "yes"
label values boughtice_yr boughtice_yrlabel

replace coldshower_yr=0 if coldshower_yr !=1
label define coldshower_yrlabel 0 "no" 1 "yes"
label values coldshower_yr coldshower_yrlabel

replace fan_yr=0 if fan_yr!=1
label define fan_yr_label 0 "no" 1 "yes"
label values fan_yr fan_yr_label

replace ac_yr=0 if ac_yr!=1
label define ac_yr_label 0 "no" 1 "yes"
label values ac_yr ac_yr_label



**binary variable representing whether a respondent used at least one strategy to ***STAY WARM*** in the last year
gen staywarm_yr=.

replace staywarm_yr=0 if stove_yr==0 & spaceheater_yr==0 & woodstove_yr==0 & fireplace_yr==0 & hotshower_yr==0 & burntrash_yr==0 & coat_blanket_yr==0


replace staywarm_yr=1 if stove_yr==1 | spaceheater_yr==1 | woodstove_yr==1 | fireplace_yr==1 | hotshower_yr==1 | burntrash_yr==1 | coat_blanket_yr==1


label define staywarm_yrlabel 0 "No coping strategies" 1 "At least one coping strategy"
label values staywarm_yr staywarm_yrlabel


**binary variable representing whether a respondent used at least one strategy to ***STAY COOL*** in the last year
gen staycool_yr=.

replace staycool_yr=0 if boughtice_yr==0 & coldshower_yr==0 & fan_yr==0 & ac_yr==0


replace staycool_yr=1 if boughtice_yr==1 | coldshower_yr==1 | fan_yr==1 | ac_yr==1

label define staycool_yrlabel 0 "No coping strategies" 1 "At least one coping strategy"
label values staycool_yr staycool_yrlabel



**Respondent used the following methods to keep a comfortable temperature in their home in the last 3 months
rename q28_1 stove_3mos1
rename q28_2 spaceheater_3mos1
rename q28_3 woodstove_3mos1
rename q28_4 fireplace_3mos1
rename q28_5 hotshower_3mos1
rename q28_6 burntrash_3mos1
rename q28_7 heavycoat_3mos1
rename q28_8 boughtice_3mos1
rename q28_9 coldshower_3mos1


replace stove_3mos1=0 if stove_3mos1 !=1
label define stove_3label 0 "no" 1 "yes"
label values stove_3mos1 stove_3label

replace spaceheater_3mos1=0 if spaceheater_3mos1 !=1
label define spaceheater_3label 0 "no" 1 "yes"
label values spaceheater_3mos1 spaceheater_3label

replace woodstove_3mos1=0 if woodstove_3mos1 !=1
label define woodstove_3label 0 "no" 1 "yes"
label values woodstove_3mos1 woodstove_3label

replace fireplace_3mos1=0 if fireplace_3mos1 !=1
label define fireplace_3label 0 "no" 1 "yes"
label values fireplace_3mos1 fireplace_3label

replace hotshower_3mos1=0 if hotshower_3mos1 !=1
label define hotshower_3label 0 "no" 1 "yes"
label values hotshower_3mos1 hotshower_3label

replace burntrash_3mos1=0 if burntrash_3mos1 !=1
label define burntrash_3label 0 "no" 1 "yes"
label values burntrash_3mos1 burntrash_3label

replace heavycoat_3mos1=0 if heavycoat_3mos1 !=1
label define heavycoat_3label 0 "no" 1 "yes"
label values heavycoat_3mos1 heavycoat_3label

replace boughtice_3mos1=0 if boughtice_3mos1 !=1
label define boughtice_3label 0 "no" 1 "yes"
label values boughtice_3mos1 boughtice_3label


replace coldshower_3mos1=0 if coldshower_3mos1 !=1
label define coldshower_3label 0 "no" 1 "yes"
label values coldshower_3mos1 coldshower_3label

**binary variable representing whether a respondent used at least one strategy to ***STAY WARM*** in the last 3 months
gen staywarm_3mos1=.

replace staywarm_3mos1=0 if stove_3mos1==0 & spaceheater_3mos1==0 & woodstove_3mos1==0 & fireplace_3mos1==0 & hotshower_3mos1==0 & burntrash_3mos1==0 & heavycoat_3mos1==0


replace staywarm_3mos1=1 if stove_3mos1==1 | spaceheater_3mos1==1 | woodstove_3mos1==1 | fireplace_3mos1==1 | hotshower_3mos1==1 | burntrash_3mos1==1 | heavycoat_3mos1==1


label define staywarm_3mos1label 0 "No coping strategies" 1 "At least one coping strategy"
label values staywarm_3mos1 staywarm_3mos1label


**binary variable representing whether a respondent used at least one strategy to ***STAY COOL*** in the last 3 months
gen staycool_3mos1=.

replace staycool_3mos1=0 if boughtice_3mos1==0 & coldshower_3mos1==0

replace staycool_3mos1=1 if boughtice_3mos1==1 | coldshower_3mos1==1

label define staycool_3mos1label 0 "No coping strategies" 1 "At least one coping strategy"
label values staycool_3mos1 staycool_3mos1label



**Respondent used the following methods to keep a comfortable temperature in their home in the last 3 months
rename q28a_1 stove_may
rename q28a_2 spaceheater_may
rename q28a_3 woodstove_may
rename q28a_4 fireplace_may
rename q28a_5 hotshower_may
rename q28a_6 burntrash_may
rename q28a_7 heavycoat_may
rename q28a_8 boughtice_may
rename q28a_9 coldshower_may


replace stove_may=0 if stove_may !=1
label define stove_maylabel 0 "no" 1 "yes"
label values stove_may stove_maylabel

replace spaceheater_may=0 if spaceheater_may !=1
label define spaceheater_maylabel 0 "no" 1 "yes"
label values spaceheater_may spaceheater_maylabel

replace woodstove_may=0 if woodstove_may !=1
label define woodstove_maylabel 0 "no" 1 "yes"
label values woodstove_may woodstove_maylabel

replace fireplace_may=0 if fireplace_may !=1
label define fireplace_maylabel 0 "no" 1 "yes"
label values fireplace_may fireplace_maylabel

replace hotshower_may=0 if hotshower_may !=1
label define hotshower_maylabel 0 "no" 1 "yes"
label values hotshower_may hotshower_maylabel

replace burntrash_may=0 if burntrash_may !=1
label define burntrash_maylabel 0 "no" 1 "yes"
label values burntrash_may burntrash_maylabel

replace heavycoat_may=0 if heavycoat_may !=1
label define heavycoat_maylabel 0 "no" 1 "yes"
label values heavycoat_may heavycoat_maylabel

replace boughtice_may=0 if boughtice_may !=1
label define boughtice_maylabel 0 "no" 1 "yes"
label values boughtice_may boughtice_maylabel


replace coldshower_may=0 if coldshower_may !=1
label define coldshower_maylabel 0 "no" 1 "yes"
label values coldshower_may coldshower_maylabel


**binary variable representing whether a respondent used at least one strategy to ***STAY WARM*** in the last 3 months
gen staywarm_may=.

replace staywarm_may=0 if stove_may==0 & spaceheater_may==0 & woodstove_may==0 & fireplace_may==0 & hotshower_may==0 & burntrash_may==0 & heavycoat_may==0


replace staywarm_may=1 if stove_may==1 | spaceheater_may==1 | woodstove_may==1 | fireplace_may==1 | hotshower_may==1 | burntrash_may==1 | heavycoat_may==1


label define staywarm_maylabel 0 "No coping strategies" 1 "At least one coping strategy"
label values staywarm_may staywarm_maylabel


**binary variable representing whether a respondent used at least one strategy to ***STAY COOL*** in the last 3 months
gen staycool_may=.

replace staycool_may=0 if boughtice_may==0 & coldshower_may==0

replace staycool_may=1 if boughtice_may==1 | coldshower_may==1

label define staycool_maylabel 0 "No coping strategies" 1 "At least one coping strategy"
label values staycool_may staycool_maylabel


**respondent had a covid diagnosis or symptoms
rename q29 covid_diagnosis1
recode covid_diagnosis1 (1=3) (3=1)
label define covid_diagnosis_label 1 "No COVID Symptoms" 2 "Symptoms but no test" 3 "Positive test"
label values covid_diagnosis1 covid_diagnosis_label


**respondent had their employment impacted by the COVID hsutdowns (reduced hours, furloughed, lost employment, re-entered the workforce, decided not to work, or no change in employment)
rename q30 covid_employment1
label define covid_employment1_label 1 "Reduced hours at job" 2 "Furloughed with pay" 3 "Furloughed without pay" 4 "Lost employment" 5 "Re-entered the workforce" 6 "Decided not to work" 7 "My employment status did not change" 8 "Other"
label values covid_employment1 covid_employment1_label

**If respondent lost employment, in which month or day
rename q31_month month_unemployed1
rename q31_day day_unemployed1

**Did respondent lose health insurance due to their job being impacted by COVID shutdowns
rename q32 covid_insurance1
label define covid_insurance1_label 1 "Yes, I lost my health insurance" 2 "No, but my employed put me on a less generous plan" 3 "No, my health insurance plan is the same" 4 "I didn't have health insurance before COVID-19"
label values covid_insurance1 covid_insurance1_label

**Did respondents' rent situation change due to the pandemic (paying as normal, paying partial amount, not paying at all)
rename q33 covid_rent_mortgage1

**Did respondent experience economic hardships due to the pandemic, including: struggling to pay rent, having to forego basic household expenses, struggling to feed family, and struggling to receive medical care
rename q34 covid_foregoexpenses1
recode covid_foregoexpenses1(2=0)
label define covid_forego 0 "no" 1 "yes"
label val covid_foregoexpenses1 covid_forego

rename q35 covid_rent1
label define covid_rent1_label 1 "Strongly disagree" 2 "Somewhat disagree" 3 "Neither agree nor disagree" 4 "Somewhat agree" 5 "Strongly agree"
label values covid_rent1 covid_rent1_label

rename q36 covid_feedfamily1
label define covid_feedfamily1_label 1 "Strongly disagree" 2 "Somewhat disagree" 3 "Neither agree nor disagree" 4 "Somewhat agree" 5 "Strongly agree"
label values covid_feedfamily1 covid_feedfamily1_label

rename q37 covid_medicalcare1
label define covid_medicalcare1_label 1 "Strongly disagree" 2 "Somewhat disagree" 3 "Neither agree nor disagree" 4 "Somewhat agree" 5 "Strongly agree"
label values covid_medicalcare1 covid_medicalcare1_label



***************************Cleaning up variables*******************************
*age of respondent
gen age=2020-birthyr



**does respondent own home?
rename ownhome ownhome1

gen homeowner1 = .
replace homeowner1 = 0 if ownhome1 ==2 | ownhome1 ==3
replace homeowner1 = 1 if ownhome1 ==1
label var homeowner1 "own home?"
label define homeownerlabel 0 "no" 1 "yes"
label values homeowner1 homeownerlabel

**Employment status
gen employed1 = .
replace employed1 = 0 if employ >1
replace employed1 = 1 if employ <3
label var employed1 "employed?"
label define employedlabel 0 "no" 1 "yes"
label values employed1 employedlabel

gen unemployed1 =0
replace unemployed1 =1 if employ==3 | employ==4
label var unemployed1 "unemployed"
label define unemployed1label 0 "no" 1 "yes"
label values unemployed1 unemployed1label

gen retired = 0
replace retired = 1 if employ ==5
replace retired = 0 if (employ <5|employ >5)
label var retired "retired?"
label define retiredlabel 0 "no" 1 "yes"
label values retired retiredlabel

rename employ employ1


**working less or not at all during the pandemic
gen covid_lostjobhours1 = 1 if covid_employment==1 | covid_employment==3 | covid_employment==4
replace covid_lostjobhours1=0 if covid_lostjobhours1==. & covid_employment!=.
label define lostjob 1 "Loss job or reduced hours" 0 "Retained job"
label val covid_lostjobhours1 lostjob


**racial and gender categories
gen white=0
replace white=1 if race==1

gen black=0
replace black=1 if race==2

gen hispanic=0
replace hispanic=1 if race==3

gen native_american=0
replace native_american=1 if race==5

gen female=0
replace female=1 if gender==2


*lost insurance due to COVID*
gen covid_lostinsurance1=.
replace covid_lostinsurance1=0 if covid_insurance1 ==2 | covid_insurance1 ==3 | covid_insurance1 ==4
replace covid_lostinsurance1=1 if covid_insurance1==1
label define lostinsurance 0 "Did not lose insurance" 1 "Lost Insurance"
lab val covid_lostinsurance1 lostinsurance


**high school degree or less
gen educ_HS1 = (educ1==1|educ1==2)
label var educ_HS1 "respondent has high school degree or less"
label define educ_HS_label 0 "No" 1 "Yes"
label values educ_HS1 educ_HS_label

**any children under 5
gen any_under51 = (hh_under51>0)
recode any_under51 *=. if hh_under51==.
label var any_under51 "at least one person in the house is under 5"
label define any_label 0 "No" 1 "Yes"
label values any_under51 any_label

**any household members over 65
gen any_over651 = (hh_over651>0)
recode any_over651 *=. if hh_over651==.
label var any_over651 "at least one person in the house is over 65"
label define any_over_label 0 "No" 1 "Yes"
label values any_over651 any_over_label

**Lost work due to COVID
gen covid_lostwork1 = (covid_employment1==1|covid_employment1==3|covid_employment1==4)
recode covid_lostwork1 *=. if covid_employment1==.
label var covid_lostwork1 "Respondent lost work pay or hours due to the pandemic"
label define lostwork_label 0 "No" 1 "Yes"
label values covid_lostwork1 lostwork_label

**no or worse insurance due to COVID
gen covid_lessinsurance1 = (covid_insurance1==1| covid_insurance1==2)
recode covid_lessinsurance1 *=. if covid_insurance1==.
label var covid_lessinsurance1 "respondent lost health insurance or employer put them on less generous plan"
label define less_insure_label 0 "No" 1 "Yes"
label values covid_lessinsurance1 less_insure_label

gen no_insurance1 = (covid_insurance1==1|covid_insurance1==4)
recode no_insurance1 *=. if covid_insurance1==.
label var no_insurance1 "respondent lost insurance or didn't have any to begin with"
label define no_insure_label 0 "No" 1 "Yes"
label values no_insurance1 no_insure_label

**any household memebrs with a disability
gen any_disability1 = (hh_disability1>0)
recode any_disability1 *=. if hh_disability1==.
label var any_disability1 "at least one person in the house has a disability"
label define any_disability_label 0 "No" 1 "Yes"
label values any_disability1 any_disability_label

**respondent lives in a trailer or mobile home
gen home_trailer1 = (dwelling_type1==1)
recode home_trailer1 *=. if dwelling_type1==.
label var home_trailer1 "respondent's home is trailer or mobile home"
label define home_trailer_label 0 "No" 1 "Yes"
label values home_trailer1 home_trailer_label

**respondent lives in an apartment, duplex, or condo
gen home_apartmentcondo1 = (dwelling_type1==2)
recode home_apartmentcondo1 *=. if dwelling_type1==.
label var home_apartmentcondo1 "respondent's home is apartment, duplex, or condo"
label define home_apartmentcondo_label 0 "No" 1 "Yes"
label values home_apartmentcondo1 home_apartmentcondo_label

**respondent lives in a single family home
gen home_singlefam1 = (dwelling_type1==3|dwelling_type1==4)
recode home_singlefam1 *=. if dwelling_type1==.
label var home_singlefam1 "respondent's home is a single family home, either attached or detached"
label define home_singlefam_label 0 "No" 1 "Yes"
label values home_singlefam1 home_singlefam_label

**respondent indicated "other" as their dwelling type
gen home_other1 = (dwelling_type1==5)
recode home_other1 *=. if dwelling_type1==.
label var home_other1 "respondent's home is recorded as other"
label define home_other_label 0 "No" 1 "Yes"
label values home_other1 home_other_label

**COVID employemnt status
rename q30_open covid_employmentchange_open1
rename employ_t employmentstatus_open1







****FPL levels (numeric)****
gen hhinc1 = "100% FPL or below" if hh1_income1==1
forvalues i = 2(1)8 {
replace hhinc1 = "100% FPL or below" if hh`i'_income1==1
}
forvalues i = 1(1)8 {
replace hhinc1 = "100%-150% FPL" if hh`i'_income1==2 | hh`i'_income1==3
}
forvalues i = 1(1)8 {
replace hhinc1 = "150%-200% FPL" if hh`i'_income1==4 | hh`i'_income1==5
}
forvalues i = 1(1)8 {
replace hhinc1 = "Over 200% FPL" if hh`i'_income1==6
}
encode hhinc1, gen(fpl1)



***Income levels by FPL***
gen under_100_fpl1=.
replace under_100_fpl1=0 if fpl1==2 | fpl1==3
replace under_100_fpl1=1 if fpl1==1

gen FPL_100_1501=.
replace FPL_100_1501=0 if fpl==1 | fpl==3
replace FPL_100_1501=1 if fpl==2

gen FPL_150_2001=.
replace FPL_150_2001=0 if fpl1==1 | fpl1==2
replace FPL_150_2001=1 if fpl1==3


**Date Unemployed**
***SOME OF THESE VARIABLES DON'T MAKE SENSE BECAUSE RESPONDENTS INDICATED THAT THEY GOT LAID OFF IN MONTHS AFTER JUNE. COULD JUST DROP ANYTHING THAT IS NOT FROM FEBRUARY-END OF MAY**
gen year = 2020
gen date=mdy(month_unemployed, day_unemployed, year)
format %td date
rename date date_unemployed1

**COVID - no symptoms versus symptoms or diagnosis
gen covid_symptoms1=0 if covid_diagnosis1==1
replace covid_symptoms1=1 if covid_diagnosis1==2 | covid_diagnosis1==3
label define covid_symptoms_label 0 "No symptoms or diagnosis" 1 "Symptoms or diagnosis"
label values covid_symptoms1 covid_symptoms_label

****Covid diagnosis****
gen positive_covid_test1 = 0 if covid_diagnosis1 ==1 | covid_diagnosis1 ==2
replace positive_covid_test1 =1 if covid_diagnosis1 ==3
label define positivecovid_label 0 "No positive test" 1 "Positive test"
label values positive_covid_test1 positivecovid_label

*****Merge zip code, urban vs rural percentage*****
sort inputzip
merge m:1 inputzip using zcta_urban_v2.dta
drop if _m==2
rename inputzip inputzip1

gen wave1=1

save CLEAN_wave1_National.dta, replace